<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/md5.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.form-horizontal{
				background: #fff;
				padding-bottom: 40px;
				border-radius: 15px;
				text-align: center;
				position: relative;
				transform: translateY(35%);
			}
			.form-horizontal .form-group{
				padding: 0 40px;
				margin: 0 0 25px 0;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<div class="row">
				<div class="col-md-offset-3 col-md-6">
					<form>
						<div class="form-group">
							<label for="exampleInputEmail1">Email address</label>
							<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
						</div>
						<div class="form-group">
							<label for="exampleInputPassword1">Password</label>
							<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
						</div>
						<div class="form-group">
							<label for="exampleInputFile">File input</label>
							<input type="file" id="exampleInputFile">
							<p class="help-block">Example block-level help text here.</p>
						</div>
						<div class="checkbox">
							<label><input type="checkbox"> Check me out</label>
						</div>
						<button type="submit" class="btn btn-default">Submit</button>
					</form>
					
					<form class="form-horizontal" id="login-form">
						<span class="heading" style="display: block;font-size: 35px;font-weight: 700;padding: 35px 0;">用户登录</span>
						<div class="form-group">
							<input type="text" class="form-control"  placeholder="用户名" name="username"/>
						</div>
						<div class="form-group">
							<input type="password" class="form-control"  placeholder="密码" name="psw" id="psw"/>
						</div>
						<div class="form-group">
							<button type="button" class="btn btn-primary form-control" id="btn-login">登录</button>
						</div>
					</form>	
					
				</div>
			</div>
		</div>
		<script type="text/javascript">
			$("#psw").change(function () {
				$("#psw").val(MD5($("#psw").val()));//密码加密
			})
			$("#btn-login").click(function () {				
				$.post("loginCheck",$("#login-form").serialize(),function (data) {
					if(data.name!=null){
						location.href="system/index.html";
					}
					else
					{
						alert("登录信息有误，请重新输入！");
					}
					console.log(data);
				});
			})
		</script>
	</body>
</html>